#include<unistd.h>
#include<stdlib.h>
#include<stdio.h>
#include<sys/wait.h>
int main()
{
	printf("Prent Process ID:%d\n",getpid());
	pid_t pid=fork();
	if(pid==0)
	{
		printf("Child Process ID:%d\n",getpid());
		execl("/bin/date","date",NULL);
		perror("excel failed");
		exit(1);

	}
	else if(pid>0)
	{	
		wait(NULL);
		printf("child Process has finished.\n");
	}
	else
	{
		perror("fork failed");
		return 1;
	}
	return 0;
}
